package com.mtsmda.java.json.jsonsimple;

import java.io.File;
import java.io.FileReader;
import java.util.Iterator;

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

public class ReadJSONFromFile {

	public static void main(String[] args) throws Exception {
		File fileJSON = new File("FootballClubs.json");
		JSONParser jsonParser = new JSONParser();
		Object parse = jsonParser.parse(new FileReader(fileJSON));
		if (parse instanceof JSONObject) {
			JSONObject jsonObject = (JSONObject) parse;
			Iterator<?> iterator = jsonObject.keySet().iterator();
			System.out.println("key - value");
			while (iterator.hasNext()) {
				Object next = iterator.next();
				System.out.println(next + " - " + jsonObject.get(next));
			}

		}

	}

}